<!DOCTYPE html>
<html lang="en">
    <head>
	    <meta charset="utf-8">
		<link href="../static/css/style1.css" rel="stylesheet" type="text/css" />
        <link rel="icon" href="../static/images/logo.ico" type="image/x-icon"/>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
        <script src="../static/js/jquery.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
		<title>个人中心</title>
	</head>

	<body>
		<div class="wapper_box">
			<div class="header_box"></div>
			<div class="header_box1">
				<div class="header_box2">
					<a class="logo_box" href="{{ url_for('index') }}"><img src="../static/images/logo1.jpeg" /></a>
					<ul class="nav_box">
						<li class="nav_1"><a class="nav_but" href="{{ url_for('personal_information') }}">个人中心</a></li>
                        <li class="nav_1"><a class="nav_but" href="{{ url_for('news_center') }}">课程论坛</a></li>
             			<li class="nav_1"><a class="nav_but" href="{{ url_for('stuCourses') }}">学生选课</a></li>
             			<li class="nav_1"><a class="nav_but" href="{{ url_for('index') }}">首页</a></li>
					</ul>
				</div>
			</div>

			<!--内容开始-->
			<div class="content_box1">
				<div class="content_box2">
					<div class="menu_box">
						<p class="menu_box_title">个人中心</p>
					</div>
					<div class="content_boxL">
						<div class="content_boxL_nav">
							<p class="content_boxL_nav_title">个人信息</p>
                            <nav aria-label="breadcrumb" class="content_boxL_nav_R" style="background-color: #FFFFFF; ">
                              <ol class="breadcrumb" style="background-color: #FFFFFF ; margin-bottom: 10px;">
                                <li class="breadcrumb-item"><a href="{{ url_for('index') }}">首页</a></li>
                                <li class="breadcrumb-item"><a href="{{ url_for('personal_information') }}">个人中心</a></li>
                                <li class="breadcrumb-item active" aria-current="page">个人信息</li>
                              </ol>
                            </nav>
						</div>
						<div class="personal">
                            <ul class="list-group list-group-flush">
                              <li class="list-group-item" id="name"></li>
                              <li class="list-group-item" id="stu_no"></li>
                              <li class="list-group-item" id="college"></li>
                              <li class="list-group-item" id="major"></li>
                            </ul>
						</div>
                    </div>
                </div>
            </div>
            <!--内容结束-->
        </div>
	</body>
    <script>
        $.ajax({
            url:'{{ url_for("profile") }}', // 地址
            dataType:'json', // 数据类型
            type:'GET', // 类型
            timeout:2000, // 超时
            success: function (data, status) { // 请求成功
                $('#name').text('姓名：'+data.姓名);
                $('#stu_no').text('学号：'+data.学号);
                $('#college').text('学院：'+data.学院);
                $('#major').text('专业：'+data.专业);
                //alert(data);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) { // 失败/超时
                if (textStatus==='timeout') {
                    alert('请求超时');
                    setTimeout(function() {
                        alert('重新请求');
                    },2000);
                }
            }
        });
    </script>
</html>